
********************************************************************************************
*** Replication files for: Demographic and Attitudinal Legacies of the Armenian Genocide ***
*** Publication:           Post-Soviet Affairs                                           ***
*** Author:                Max Schaub, University of Hamburg                             ***
********************************************************************************************



// Setup

* Set working directory 
cd "..."

* Load dataset
use "armeniangenocide.dta", clear


* Install packages
ssc install coefplot, replace // thanks to Ben Jann
ssc install estout, replace // thanks to Ben Jann (once more)
ssc install blindschemes, replace // thanks to Daniel Bischof

* Graphics setup
graph set window fontface "Times New Roman"
set scheme plotplain

	
* Program for standardizing variables
cap program drop standardize
program define standardize
cap drop std_*
revrs ethnocentrism
foreach var of varlist married education economic_situation churchattend diaeast diawest karabakh ethnocentrism militarism reconciliation_attitude recognition_attitude{
	egen std_`var' = std(`var')
	sum std_`var'
	replace std_`var' = std_`var' + abs(r(min))
	sum std_`var'
	replace std_`var' = std_`var'/r(max)
}
label variable std_ethnocentrism "Ethnocentrism"
label variable std_militarism "Militarism"
label variable std_reconciliation_attitude "Reconciliation"
label variable std_recognition_attitude "Recognition"
end



// Figure 2a

recode famorig (1=1 "Current-day Armenia") (2=2 `""Russian Armenia""') (3 4 = 3 "Ottoman Empire") (5=4 "Persia") (6=5 "Soviet Union") (7=6 "Western Europe") (99=99 "Unknown"), gen(rfamorig)
graph bar [aw=sampling_weight], over(rfamorig) horizontal ytitle("Percent", size(vsmall)) blabel(total, format(%9.1f) size(vsmall)) ylab(, labsize(vsmall) nogrid)
graph display, ysize(1.85) xsize(2.3) scale(1.4) scheme(plotplain) margin(none)
graph export "Figures/ancestorplot.pdf", replace



// Figure 2b

recode genocideind (0 = 0 "No") (1 = 1 "Yes") (.a = 99 "DN") (.b = 88 "Refuse talk"), gen(killed)
graph bar [aw=sampling_weight], over(killed) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) yla(, nogrid) 
graph display, ysize(2.75) xsize(1.8) scale(1.6) scheme(plotplain) 
graph export "Figures/killed.pdf", replace



// Figure 3a

preserve
collapse warm_* [aw=sampling_weight]
xpose, clear varname
matrix counter  =  (3\1\2\4)
svmat counter
label define counter 1 "Russia" 2 "USA" 3 "Turkey" 4 "Azerbaijan", replace
label values counter1 counter 
format %2.0f v1
twoway (scatter v1 counter1, msym(none) mlab(v1) mlabsize(vsmall) mlabpos(12)) (bar v1 counter1, yla(, nogrid) xla(, valuelabel labsize(medsmall) nogrid) ///
barw(0.8 ..) legend(off) xsc(titlegap(*8)) yla(, format(%2.0f)) ///
ytitle(percent) xtitle("") ytitle("") title("Overall", size(medium)) ytitle("Feeling thermometer", size(small)))
graph display, ysize(1) xsize(1) scale(1.4) scheme(plotplain) 
graph export "Figures/warm_overall.pdf", replace
restore


// Figure 3b

* Multiple imputation
cap mi unregister *
cap mi unset

* Program standardize
standardize

recode genocideind(.a .b = .), gen(genocidednmissing1)
recode genocideind(.a .b = .), gen(genocidednmissing2)
recode genocideind(.a .b = .), gen(genocidednmissing3)
recode genocideind(.a .b = .), gen(genocidednmissing4)

mi set wide
mi register imputed genocidednmissing* refugee std_ethnocentrism donations 
mi register regular female age married education famorig province_origin reconciliation_attitude recognition_attitude militarism
save "Imputations/mi_master.dta", replace

* Create four datasets with imputations (needed for plotting)
use "Imputations/mi_master.dta", clear
mi impute chained (regress) std_ethnocentrism (logit) refugee (logit) donations (logit) genocidednmissing1 = female age married education reconciliation_attitude recognition_attitude militarism i.province_origin, add(50) rseed(12049)
save "Imputations/genocidednmissing1.dta", replace 
use "Imputations/mi_master.dta", clear
mi impute chained (regress) std_ethnocentrism (logit) refugee (logit) donations (logit) genocidednmissing2 = female age married education reconciliation_attitude recognition_attitude militarism i.province_origin, add(50) rseed(12049)
save "Imputations/genocidednmissing2.dta", replace 
use "Imputations/mi_master.dta", clear
mi impute chained (regress) std_ethnocentrism (logit) refugee (logit) donations (logit) genocidednmissing3 = female age married education reconciliation_attitude recognition_attitude militarism i.province_origin, add(50) rseed(12049)
save "Imputations/genocidednmissing3.dta", replace 
use "Imputations/mi_master.dta", clear
mi impute chained (regress) std_ethnocentrism (logit) refugee (logit) donations (logit) genocidednmissing4 = female age married education reconciliation_attitude recognition_attitude militarism i.province_origin, add(50) rseed(12049)
save "Imputations/genocidednmissing4.dta", replace 

* Coefficient plot
use "Imputations/genocidednmissing1.dta", clear
mi estimate, post: regress warm_usa genocidednmissing1 age female refugee edu 
eststo warm_usa_imp
estimates save "Estimates/warm_usa_imp", replace
use "Imputations/genocidednmissing2.dta", clear
mi estimate, post: regress warm_russia genocidednmissing2 age female refugee edu 
estimates save "Estimates/warm_russia_imp", replace
use "Imputations/genocidednmissing3.dta", clear
mi estimate, post: regress warm_turkey genocidednmissing3 age female refugee edu 
estimates save "Estimates/warm_turkey_imp", replace
use "Imputations/genocidednmissing4.dta", clear
mi estimate, post: regress warm_azerbaijan genocidednmissing4 age female refugee edu 
estimates save "Estimates/warm_azerbaijan_imp", replace

clear
eststo clear
estimates use Estimates/warm_usa_imp
eststo warm_usa_imp
estimates use Estimates/warm_russia_imp
eststo warm_russia_imp
estimates use Estimates/warm_turkey_imp
eststo warm_turkey_imp
estimates use Estimates/warm_azerbaijan_imp
eststo warm_azerbaijan_imp

*plot
coefplot (warm_usa_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(warm_russia_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(warm_turkey_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(warm_azerbaijan_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	 xscale(range(-6 (2) 4)) xlabel(-6 (2) 4, format(%03.1f) nogrid labsize(small)) legend(off) ///
	coeflab(genocidednmissing1 = "USA" genocidednmissing2 = "Russia" genocidednmissing3 = "Turkey" genocidednmissing4 = "Azerbaijan") ///
	ylab(, notick nogrid) title("") grid(none) title("Victimized vs. non-victimized", size(medium) position(11)) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/warm_vict.pdf", replace

// Table A2
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 


// Figure 4a 
use "armeniangenocide.dta", clear
label define disagree 1 "Agree" 5 "Disagree", replace
label values ethnocentrism disagree
graph bar [aw=sampling_weight], over(ethnocentrism) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Allow non-Armenian immigrants")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/ethnocentrism.pdf", replace


// Figure 4b

label define support 1 "Oppose" 5 "Support", replace
label values reconciliation_attitude support
graph bar [aw=sampling_weight], over(reconciliation_attitude) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Reconciliation with Turkey")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/reconciliation.pdf", replace


// Figure 4c 

label define justified 1 "Unjustified" 4 "Justified", replace
label values militarism justified
graph bar [aw=sampling_weight], over(militarism) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Attack to recover territory")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/attack.pdf", replace


// Figure 4d

label define priority 1 "Lowest" 4 "Highest", replace
label values recognition_attitude priority
graph bar [aw=sampling_weight], over(recognition_attitude) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Priority genocide recognition")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/recognition.pdf", replace
		

// Figure 5

use "Imputations/genocidednmissing1.dta", clear
mi estimate, post: regress std_ethnocentrism genocidednmissing1 age female refugee edu 
estimates save "Estimates/ethnocentrism_imp", replace
use "Imputations/genocidednmissing2.dta", clear
mi estimate, post: regress std_reconciliation_attitude genocidednmissing2 age female refugee edu 
estimates save "Estimates/reconciliation_imp", replace
use "Imputations/genocidednmissing3.dta", clear
mi estimate, post: regress std_militarism genocidednmissing3 age female refugee edu 
estimates save "Estimates/attack_imp", replace
use "Imputations/genocidednmissing4.dta", clear
mi estimate, post: regress std_recognition_attitude genocidednmissing4 age female refugee edu 
estimates save "Estimates/recognition_imp", replace

* load estimates
clear
eststo clear
estimates use Estimates/ethnocentrism_imp
eststo ethnocentrism_imp
estimates use Estimates/reconciliation_imp
eststo reconciliation_imp
estimates use Estimates/attack_imp
eststo attack_imp
estimates use Estimates/recognition_imp
eststo recognition_imp

*plot
coefplot (ethnocentrism_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(attack_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(reconciliation_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(recognition_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xscale(range(-0.10 (0.05) 0.10)) xlabel(-0.10 (0.05) 0.10, format(%03.2f) nogrid labsize(small)) legend(off) ///
	coeflab(genocidednmissing1 = "Ethnocentrism" genocidednmissing2 = "Reconciliation" genocidednmissing3 = "Militarism" genocidednmissing4 = "Recognition") ///
	ylab(, notick nogrid) title("") grid(none) title("Victimized vs. non-victimized", size(medium) position(11)) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/attitudes.pdf", replace

* Table A3
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 

		
// Figure 6a

use "armeniangenocide.dta", clear
cap drop sons1 sons2 sons3
tab sons_army, gen(sons)
preserve
clear matrix
collapse donations veterans_donation hrantdink_donation sons1 sons2 sons3 [aw=sampling_weight]
xpose, clear varname
set obs 6 
matrix counter  =  (1\2\3\4\5\6)
svmat counter
label define counter 1 "All" 2 "Veteran" 3 "Dink" 4 "Not" 5 "Front" 6 "Else", replace
label values counter counter 
format %3.2f v1
twoway (scatter v1 counter1, msym(none) mlab(v1) mlabsize(vsmall) mlabpos(12)) (bar v1 counter1, xla(, valuelabel labsize(medsmall)) ///
barw(0.8 ..) legend(off) xsc(titlegap(*8)) xlab(, labsize(small) notick nogrid) ysc(range(0 (.2) 1)) yla(0 (.2) 1, format(%2.1f) labsize(small) notick nogrid) ///
ytitle(percent) xtitle("")  title("Donations         |  Location served", size(medium) position(11)) ytitle("Share", size(small)))
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/donation_sons_overall.pdf", replace
restore
	

// Figure 6b

use "Imputations/genocidednmissing1.dta", clear
mi estimate, post: regress donations genocidednmissing1 age female refugee edu 
estimates save "Estimates/donations_imp", replace
use "Imputations/genocidednmissing2.dta", clear
mi estimate, post: regress veterans_donation genocidednmissing2 age female refugee edu 
estimates save "Estimates/veteransdonation_imp", replace
use "Imputations/genocidednmissing3.dta", clear
mi estimate, post: regress hrantdink_donation genocidednmissing3 age female refugee edu 
estimates save "Estimates/reconciliationdonation_imp", replace
use "Imputations/genocidednmissing4.dta", clear
mi estimate, post: regress sons_frontline genocidednmissing4 age female refugee edu 
estimates save "Estimates/fontline_imp", replace

* load estimates
clear
eststo clear
estimates use Estimates/donations_imp
eststo donations_imp
estimates use Estimates/veteransdonation_imp
eststo veteransdonation_imp
estimates use Estimates/reconciliationdonation_imp
eststo reconciliationdonation_imp
estimates use Estimates/fontline_imp
eststo fontline_imp

*plot
coefplot (donations_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(veteransdonation_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(reconciliationdonation_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(fontline_imp, keep(genocidednmissing*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xscale(range(-0.10 (0.05) 0.10)) xlabel(-0.10 (0.05) 0.10, format(%03.2f) nogrid labsize(small)) legend(off) ///
	coeflab(genocidednmissing1 = "Overall" genocidednmissing2 = "Veterans" genocidednmissing3 = "Hrant Dink" genocidednmissing4 = "Frontline") ///
	ylab(, notick nogrid) title("") grid(none) title("Victimized vs. non-victimized", size(medium) position(11) margin(none)) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/donation_son_vict.pdf", replace

* Table A4
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 


// Figure 7

use "armeniangenocide.dta", clear
standardize
svyset [pweight=sampling_weight], psu(precinct) strata(substratum)

cap drop g20 g30 g40 g50 g60 g70 g80
eststo clear
forval age==20 (10) 80{
		gen g`age' = genocidebinary
        quietly: svy: reg std_ethnocentrism i.g`age'##c.age##c.age female refugee edu
		margins, dydx(g`age') at(age==(`age')) post
        eststo m`age'
     }
coefplot m*, vert ytitle("Ethnocentrism") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "20" 2 "30" 3 "40" 4 "50" 5 "60" 6 "70" 7 "80") name(marginsageethnocentrism, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p2(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p3(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p4(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 


cap drop g20 g30 g40 g50 g60 g70 g80
eststo clear
forval age==20 (10) 80{
		gen g`age' = genocidebinary
        quietly: svy: reg std_militarism i.g`age'##c.age##c.age female refugee edu
		margins, dydx(g`age') at(age==(`age')) post
        eststo m`age'
     }
coefplot m*, vert ytitle("Militarism") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "20" 2 "30" 3 "40" 4 "50" 5 "60" 6 "70" 7 "80") name(marginsmilitarism, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p6(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p7(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 

			
cap drop g20 g30 g40 g50 g60 g70 g80
eststo clear
forval age==20 (10) 80{
		gen g`age' = genocidebinary
        quietly: svy: reg std_recognition_attitude i.g`age'##c.age##c.age female refugee edu
		margins, dydx(g`age') at(age==(`age')) post
        eststo m`age'
     }
coefplot m*, vert ytitle("Recognition highest priority") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "20" 2 "30" 3 "40" 4 "50" 5 "60" 6 "70" 7 "80") name(marginsagerecognition, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p5(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p6(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p7(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p8(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 


cap drop g20 g30 g40 g50 g60 g70 g80
eststo clear
forval age==20 (10) 80{
		gen g`age' = genocidebinary
        quietly: svy: reg donations i.g`age'##c.age##c.age female refugee edu
		margins, dydx(g`age') at(age==(`age')) post
        eststo m`age'
     }
coefplot m*, vert ytitle("Donated") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "20" 2 "30" 3 "40" 4 "50" 5 "60" 6 "70" 7 "80") name(marginsagedonated, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p2(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p3(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p4(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 

graph combine marginsageethnocentrism marginsmilitarism marginsagerecognition marginsagedonated, col(2)
graph display, ysize(1) xsize(1.3) scale(1) 
graph export "Figures/marginsage.pdf", replace


// Figure A1a

cap drop marstat
recode marital_status (1 = 1 "Married") (6 = 2 "Single") (5 = 3 "Widowed") (2 3 4 = 4 "Other"), gen(marstat)
label variable marstat "Marital status"
label values marstat marstat
graph bar [aw=sampling_weight], over(marstat) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Marital status")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/marstat.pdf", replace


// Figure A1b

cap drop medu 
recode education (1/9 = 1 "1-9y") (10 = 2 "10y") (11/13 = 3 "11-13y") (14/15 = 4 "14-15y") (16/24 = 5 "16y+"), gen(medu)
label variable medu "Years of education"
graph bar [aw=sampling_weight], over(medu) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Years of education")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/edu.pdf", replace


// Figure A1c

cap drop econsit
clonevar econsit = economic_situation
label variable econsit "Economic situation"
label define econsit 1 "Food lacking" 2 "" 3 "" 4 "" 5 "Afford all", replace
label values econsit econsit
graph bar [aw=sampling_weight], over(econsit) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid) title("Economic situation")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/econsit.pdf", replace


// Figure A1d

cap drop relfreq
clonevar relfreq = churchattend
label variable relfreq "Church attendance"
label define relfreq 1 "Never" 2 "." 3 "." 4 "On holidays" 5 "." 6 "." 7 "1+/week", replace
label values relfreq relfreq
graph bar [aw=sampling_weight], over(relfreq) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid)  title("Church attendance")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/relfreq.pdf", replace


// Figure A1e

cap drop diaeastwest
gen diaeastwest = 0
replace diaeastwest = 1 if diaeast==1
replace diaeastwest = 2 if diawest==1
replace diaeastwest = 3 if diaeast==1 & diawest==1
label variable diaeastwest "Diaspora contacts"
label define diaeastwest 0 "None" 1 "East" 2 "West" 3 "Both", replace
label values diaeastwest diaeastwest
graph bar [aw=sampling_weight], over(diaeastwest) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid)  title("Diaspora contacts")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/diaspora.pdf", replace


// Figure A1f

label variable karabakh "Relative killed in Karabakh"
label define karabakh 0 "No" 1 "Yes", replace
label values karabakh karabakh
graph bar [aw=sampling_weight], over(karabakh, gap(*3)) ytitle("Percent", size(small)) blabel(total, format(%9.1f) size(vsmall)) ylab(, notick nogrid)  title("Relative killed in Karabakh")
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/karabakh.pdf", replace


// Figure A1g

* program standardize
standardize

eststo clear
foreach var of varlist married education economic_situation churchattend diaeast diawest karabakh{
	svy: reg std_`var' genocidebinary female age 
	eststo `var'vict
}
esttab *, booktabs ///
	varwidth(35) label order(genocidebinary*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 


eststo clear
cap drop genocidebinary_*
clonevar genocidebinary_married = genocidebinary
label variable genocidebinary_married "Married"
clonevar genocidebinary_education = genocidebinary
label variable genocidebinary_education "Education"
clonevar genocidebinary_econsit = genocidebinary
label variable genocidebinary_econsit "Econ situation"
clonevar genocidebinary_church = genocidebinary
label variable genocidebinary_church "Church attend"
clonevar genocidebinary_diaeast = genocidebinary
label variable genocidebinary_diaeast "Diaspora East"
clonevar genocidebinary_diawest = genocidebinary
label variable genocidebinary_diawest "Diaspora West"
clonevar genocidebinary_karabakh = genocidebinary
label variable genocidebinary_karabakh "Killed Karabakh"
cap mi unset
svy: reg married genocidebinary_married female age
eststo vict_married
svy: reg education genocidebinary_education female age
eststo vict_education
svy: reg economic_situation genocidebinary_econsit female age
eststo vict_econsit
svy: reg churchattend genocidebinary_church female age
eststo vict_church
svy: reg diaeast genocidebinary_diaeast female age 
eststo vict_diaeast
svy: reg diawest genocidebinary_diawest female age 
eststo vict_diawest
svy: reg karabakh genocidebinary_karabakh female age 
eststo vict_karabakh

coefplot (vict_married, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7)))  ///
		(vict_education, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(vict_econsit, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(vict_church, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(vict_diaeast, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(vict_diawest, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(vict_karabakh, keep(genocidebinary_karabakh) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xlabel(, format(%02.1f) nogrid labsize(small)) legend(off) title("Victimized vs. non-victimized", size(medium)) ///
	ylab(, notick nogrid) grid(none) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/demographics_vict.pdf", replace



// Table A1
standardize

eststo clear
foreach var of varlist married education economic_situation churchattend diaeast diawest karabakh{
	svy: reg std_`var' genocidebinary female age 
	eststo `var'vict
}
esttab *, booktabs ///
	varwidth(35) label order(genocidebinary*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 


// Figure A2

// Information sources

label define genocidebinarydn 0 "No victims" 1 "Victims in family", replace
label values genocidebinarydn genocidebinarydn
label define refugee 0 "No refugee origins" 1 "Descends from refugees", replace
label values refugee refugee
clonevar gi = genocide_info
label define gi 1 "Personal stories from ancestors" 2 "General family conversations" 3 "School and/or university " 4 "Exhibitions, TV documentaries" 5 "Reading and self-educating" 6 "Other", replace
label values gi gi 
graph hbar [aw=sampling_weight], over(gi) by(genocidebinarydn, note("") col(1)) ytitle("") ylab(, notick nogrid) blabel(total, format(%9.1f) size(vsmall)) 
graph display, ysize(1.3) xsize(1.5) scale(1.1) scheme(plotplain) 
graph export "Figures/info_vict.pdf", replace


// Figure A3a

cap drop genocidebinary_*
clonevar genocidebinary_russia = genocidebinary
label variable genocidebinary_russia "Russia"
clonevar genocidebinary_usa = genocidebinary
label variable genocidebinary_usa "USA"
clonevar genocidebinary_turkey = genocidebinary
label variable genocidebinary_turkey "Turkey"
clonevar genocidebinary_azerbaijan = genocidebinary
label variable genocidebinary_azerbaijan "Azerbaijan"

svy: reg warm_russia refugee genocidebinary_russia female age edu
eststo warm_vict_russia
svy: reg warm_usa refugee genocidebinary_usa female age edu
eststo warm_vict_usa
svy: reg warm_turkey refugee genocidebinary_turkey female age edu
eststo warm_vict_turkey
svy: reg warm_azerbaijan refugee genocidebinary_azerbaijan female age edu
eststo warm_vict_azerbaijan

coefplot (warm_vict_russia, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)))  ///
		(warm_vict_usa, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(warm_vict_turkey, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(warm_vict_azerbaijan, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xscale(range(-8 (2) 4)) xlabel(-8 (2) 4, format(%02.1f) nogrid labsize(small)) legend(off) title("Victimized vs. non-victimized", size(medium)) ///
	ylab(, notick nogrid) grid(none) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/warm_vict_nonimp.pdf", replace


// Figure A3b

standardize
cap drop genocidebinary_*
clonevar genocidebinary_ethnocentrism = genocidebinary
label variable genocidebinary_ethnocentrism "Ethnocentrism"
clonevar genocidebinary_militarism = genocidebinary
label variable genocidebinary_militarism "Militarism"
clonevar genocidebinary_reconciliation = genocidebinary
label variable genocidebinary_reconciliation "Reconciliation"
clonevar genocidebinary_recognition = genocidebinary
label variable genocidebinary_recognition "Recognition"

svy: reg std_ethnocentrism genocidebinary_ethnocentrism refugee female age edu
eststo vict_ethnocentrism
svy: reg std_militarism genocidebinary_militarism refugee female age edu
eststo vict_militarism
svy: reg std_reconciliation_attitude genocidebinary_reconciliation refugee female age edu
eststo vict_reconciliation
svy: reg std_recognition_attitude genocidebinary_recognition refugee female age edu
eststo vict_recognition

coefplot (vict_ethnocentrism, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(vict_militarism, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(vict_reconciliation, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13)levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(vict_recognition, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xscale(range(-0.10 (0.05) 0.10)) xlabel(-0.10 (0.05) 0.10, format(%03.2f) nogrid labsize(small)) legend(off) ///
	ylab(, notick nogrid) title("") grid(none) title("Victimized vs. non-victimized", size(medium) position(11)) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/attitudes_nonimp.pdf", replace


// Figure A3c

cap drop genocidebinary_*
clonevar genocidebinary_donations = genocidebinary
label variable genocidebinary_donations "All donations"
clonevar genocidebinary_veterans = genocidebinary
label variable genocidebinary_veterans "Veterans"
clonevar genocidebinary_reconciliation = genocidebinary
label variable genocidebinary_reconciliation "Hrant Dink"
clonevar genocidebinary_frontline = genocidebinary
label variable genocidebinary_frontline "Son frontline"

svy: reg donations genocidebinary_donations refugee female age edu
eststo donation_overall_vict
svy: reg veterans_donation genocidebinary_veterans refugee female age edu
eststo donation_veterans_vict
svy: reg hrantdink_donation genocidebinary_reconciliation refugee female age edu
eststo donation_dink_vict
svy: reg sons_frontline genocidebinary_frontline refugee female age edu
eststo sons_frontline_vict

coefplot (donation_overall_vict, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(donation_veterans_vict, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs3) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7))) ///
		(donation_dink_vict, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
		(sons_frontline_vict, keep(genocidebinary*) msymbol(T) mfcolor(white) mcolor(gs13) levels(95 90) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
	,   xline(0, lpattern(dot)) ///
	xscale(range(-0.1 (.05) .1)) xlabel(-0.1 (.05) .1, format(%02.1f) nogrid labsize(small)) legend(off) ///
	ylab(, notick nogrid) title("") grid(none) title("Victimized vs. non-victimized", size(medium) position(11)) 
graph display, ysize(1) xsize(1) scale(1.5) scheme(plotplain) 
graph export "Figures/donation_son_vict_nonimp.pdf", replace

		
// Table A5

eststo clear
use "Imputations/genocidednmissing1.dta", clear
label variable genocidednmissing1 "Family member killed"
label variable diaeast "Diaspora West"
label variable diawest "Diaspora East"
label variable genocidednmissing1 "Family member killed"
foreach dv of varlist warm_usa warm_russia warm_turkey warm_azerbaijan {
	mi estimate, post: regress `dv' genocidednmissing1 age female refugee edu married economic_situation churchattend diaeast diawest karabakh
	eststo `dv'
}
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 

		
// Table A6

eststo clear
use "Imputations/genocidednmissing1.dta", clear
label variable genocidednmissing1 "Family member killed"
label variable diaeast "Diaspora West"
label variable diawest "Diaspora East"
cap drop std_*
revrs ethnocentrism
foreach var of varlist ethnocentrism militarism reconciliation_attitude recognition_attitude{
	egen std_`var' = std(`var')
	sum std_`var'
	replace std_`var' = std_`var' + abs(r(min))
	sum std_`var'
	replace std_`var' = std_`var'/r(max)
}
label variable std_ethnocentrism "Ethnocentrism"
label variable std_militarism "Militarism"
label variable std_reconciliation_attitude "Reconciliation"
label variable std_recognition_attitude "Recognition"
foreach dv of varlist std_ethnocentrism std_reconciliation_attitude std_militarism std_recognition_attitude{
	mi estimate, post: regress `dv' genocidednmissing1 age female refugee edu married economic_situation churchattend diaeast diawest karabakh
	eststo `dv'
}
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 

	
// Table A7

eststo clear
use "Imputations/genocidednmissing1.dta", clear
label variable genocidednmissing1 "Family member killed"
label variable diaeast "Diaspora West"
label variable diawest "Diaspora East"
label variable genocidednmissing1 "Family member killed"
foreach dv of varlist donations veterans_donation hrantdink_donation sons_frontline{
	mi estimate, post: regress `dv' genocidednmissing1 age female refugee edu married economic_situation churchattend diaeast diawest karabakh
	eststo `dv'
}
esttab *, booktabs ///
	varwidth(35) label order(genocidednmissing*) ///
		b(%9.2f) sfmt(%9.2gc) star(* .1 ** .05 *** .01) se compress nogaps  stats(N r2, fmt(%9.0gc %9.2f))  replace 
 
		
// Figure A4		

use "armeniangenocide.dta", clear
standardize
svyset [pweight=sampling_weight], psu(precinct) strata(substratum)

cap drop g0 g1 g2 g3 g4 
eststo clear
forval dia==0/4{
		gen g`dia' = genocidebinary
        quietly: reg std_ethnocentrism c.g`dia'##c.ndiaspora##c.ndiaspora age female refugee edu
		margins, dydx(g`dia') at(ndiaspora==(`dia')) post
        eststo m`dia'
     }
coefplot m*, vert ytitle("Ethnocentrism") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "None" 2 "1" 3 "2" 4 "3" 5 "4+") name(diaethnocentrism, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p2(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p3(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 


cap drop g0 g1 g2 g3 g4 
eststo clear
forval dia==0/4{
		gen g`dia' = genocidebinary
        quietly: svy: reg std_militarism c.g`dia'##c.ndiaspora##c.ndiaspora age female refugee edu
		margins, dydx(g`dia') at(ndiaspora==(`dia')) post
        eststo m`dia'
     }
coefplot m*, vert ytitle("Militarism") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "None" 2 "1" 3 "2" 4 "3" 5 "4+") name(diamilitarism, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p4(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p5(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 


cap drop g0 g1 g2 g3 g4 
eststo clear
forval dia==0/4{
		gen g`dia' = genocidebinary
        quietly: svy: reg std_reconciliation_attitude c.g`dia'##c.ndiaspora##c.ndiaspora age female refugee edu
		margins, dydx(g`dia') at(ndiaspora==(`dia')) post
        eststo m`dia'
     }
coefplot m*, vert ytitle("Reconciliation") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "None" 2 "1" 3 "2" 4 "3" 5 "4+") name(diareconciliation, replace) ///
			p1(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p2(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p3(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p4(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p5(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 

			
cap drop g0 g1 g2 g3 g4 
eststo clear
forval dia==0/4{
		gen g`dia' = genocidebinary
        quietly: svy: reg std_recognition_attitude c.g`dia'##c.ndiaspora##c.ndiaspora age female refugee edu
		margins, dydx(g`dia') at(ndiaspora==(`dia')) post
        eststo m`dia'
     }
coefplot m*, vert ytitle("Recognition") recast(scatter) nokey yline(0) mcolor(gs3) msymbol(T) levels(95 90) ciopts(color(gs3 gs3) lwidth(*.8 *1.7)) ///
			ylab(, nogrid format(%03.2f) labsize(small)) title("") xlab(1 "None" 2 "1" 3 "2" 4 "3" 5 "4+") name(diarecognition, replace) ///
			p3(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p4(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) ///
			p5(mcolor(gs13) msymbol(T) ciopts(color(gs13 gs13) lwidth(*.8 *1.7))) 
			

graph combine diaethnocentrism diamilitarism diareconciliation diarecognition, col(2) name(mcontactall, replace)
graph display, ysize(1) xsize(1.3) scale(1) 
graph export "Figures/marginsdia.pdf", replace

	
